//
//  GuideViewController.m
//  FLHBaseProject
//
//  Created by fance on 16/5/27.
//  Copyright © 2016年 Fance. All rights reserved.
//

#import "GuideViewController.h"

@interface GuideViewController (){
    UIScrollView *mScrollView;
}

@end

@implementation GuideViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    mScrollView = [[UIScrollView alloc] init];
    mScrollView.frame = CGRectMake(0, 0, SCREENWIDTH, SCREENHEIGHT);
    mScrollView.contentSize = CGSizeMake(SCREENWIDTH * 3, SCREENHEIGHT);
    mScrollView.pagingEnabled = YES; // 设置pagingEnabled=YES即可，UIScrollView会被分割成多个独立页面，用户的滚动体验则变成了页面翻转
    UIImageView *imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREENWIDTH, SCREENHEIGHT)];
    imageView1.contentMode = UIViewContentModeScaleAspectFit;
    imageView1.image = [UIImage imageNamed:@"ydy-01"];
    [mScrollView addSubview:imageView1];
    UIImageView *imageView2 = [[UIImageView alloc]initWithFrame:CGRectMake(SCREENWIDTH, 0, SCREENWIDTH, SCREENHEIGHT)];
    imageView2.image = [UIImage imageNamed:@"ydy-02"];
    imageView2.contentMode = UIViewContentModeScaleAspectFit;
    [mScrollView addSubview:imageView2];
    UIImageView *imageView3 = [[UIImageView alloc]initWithFrame:CGRectMake(SCREENWIDTH*2, 0, SCREENWIDTH, SCREENHEIGHT)];
    imageView3.image = [UIImage imageNamed:@"ydy-03"];
    imageView3.contentMode = UIViewContentModeScaleAspectFit;
    [mScrollView addSubview:imageView3];
    
    UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(80+SCREENWIDTH*2, SCREENHEIGHT-120, SCREENWIDTH-160, 50)];
    [button addTarget:self action:@selector(gotoToLogin) forControlEvents:UIControlEventTouchUpInside];
    [button setTitle:@"开始体验>>" forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont systemFontOfSize:12];
    button.backgroundColor = [UIColor clearColor];
    mScrollView.showsHorizontalScrollIndicator = NO;
    mScrollView.showsVerticalScrollIndicator = NO;
    [mScrollView addSubview:button];
    [self.view addSubview:mScrollView];
    // Do any additional setup after loading the view.
}

- (void)gotoToLogin{
    [self.delegate gotoToLoginVC];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
